<template>
	<view>
		<view class="">
			<map 
				style="width: 750rpx; height: 270px"
				:latitude="cover[0].latitude"
				:longitude="cover[0].longitude"
				:markers="cover"
				scale="18"
			></map>
		</view>
	</view>
</template>

<script>
	export default {
		onLoad: function() {
			console.log(this.cover[0])
			this.getLocation()
		},
		data() {
			return {
				cover : [{
					id: 1,
					title : '223',
					latitude : 0,
					longitude : 0,
					callout: {					
                        content: '硅谷广场B座', 
                        color: '#333', 
                        fontSize: 14,
                        borderRadius: 10, 
                        bgColor: '#fff', 
                        display: 'ALWAYS', 
                        padding:10,
					}
				}]
			}
		},
		methods: {
			getLocation() {
				uni.getLocation({
					type: 'gcj02',
					success: (res) => {
						this.latitude = Number(res.latitude)
						this.longitude = Number(res.longitude)
						this.cover[0].latitude = Number(res.latitude)
						this.cover[0].longitude = Number(res.longitude)
						console.log(res)
					}
				})
			}
		}
	}
</script>

<style>

</style>
